<?php

class Context
{
    static public $server;
    static public $get;
    static public $post;
    static public $session;
    static public $cookies;
    static public $uploadedFiles;

    static public $request;

    static public $isAjax = false;

    static public function Init()
    {
        Context::$server = new Server();
        Context::$get = new Get();
        Context::$session = new Session();
        Context::$cookies = new Cookies(Config::$defCookiesTime);
        Context::$post = new Post();
        Context::$uploadedFiles = new UploadedFiles();

        Context::$request["protocol"] = Context::$server["HTTPS"] == "on" ? "https" : "http";
        Context::$request["protocolver"] = Context::$server["SERVER_PROTOCOL"];
        Context::$request["host"] = Context::$request["protocol"]."://".Context::$server["HTTP_HOST"];
        Context::$request["uri"] = Context::$server["REQUEST_URI"];
        Context::$request["url"] = Context::$request["host"].Context::$request["uri"];
        Context::$request["rootdir"] = $_SERVER["DOCUMENT_ROOT"];
        Context::$isAjax = Context::$get["ajax"] || Context::$post["ajax"];
        Context::$request["ajax"] = Context::$isAjax;
      
    }
};

Context::Init();

?>
